#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
int main()
{
	char arr[259] = { 0 }, arr1[259] = { 0 };
	gets(arr);
	int a = strlen(arr);
	int i = 0;
	for (i = 0; i < a; i++)
	{
		if (arr[i] == 'A')
		{
			arr1[i] = 'T';
			continue;
		}
		if (arr[i] == 'T')
		{
			arr1[i] = 'A';
			continue;
		}
		if (arr[i] == 'G')
		{
			arr1[i] = 'C';
			continue;
		}
		if (arr[i] == 'C')
		{
			arr1[i] = 'G';
			continue;
		}
	}
	for (i = 0; i < a; i++)
	{
		printf("%c", arr1[i]);
	}

	return 0;
}
